package nl.tudelft.jpacman.level;

import nl.tudelft.jpacman.npc.Ghost;
import nl.tudelft.jpacman.points.PointCalculator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.mockito.Mockito.verify;
import org.junit.jupiter.api.DisplayName;

import static org.mockito.Mockito.mock;


class PlayerCollisionsTest {

    private PlayerCollisions playerCollisions;
    private PointCalculator pointCalculator = mock(PointCalculator.class);
    @BeforeEach
    void setup() {
        playerCollisions = new PlayerCollisions(pointCalculator);
    }
    @Test
    @DisplayName("Player移动到Ghost位置")
    void PlayerCollisionsGhost() {
        Player player = mock(Player.class);
        Ghost ghost = mock(Ghost.class);

        playerCollisions.collide(player,ghost);

        verify(pointCalculator).collidedWithAGhost(player,ghost);
        verify(player).setAlive(false);
        verify(player).setKiller(ghost);
    }
}
